<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <title> New Document </title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <link rel="stylesheet" href="/common/js/datepicker/css/smoothness/jquery-ui-1.9.2.custom.min.css"/>
 
<script type="text/javascript" src="/common/js/jquery-1.11.0.js"></script>
<script type="text/javascript" src="/common/js/common.js"></script>
<script type="text/javascript" src="/common/js/serviceCall.js"></script>
<script type="text/javascript" src="/common/js/datepicker/jquery-ui-1.9.2.custom.js"></script>
<script type="text/javascript" src="/common/js/datepicker/datepicker.config.js"></script>
<script type="text/javascript" src="/common/js/date.js"></script>
<script type="text/javascript" src="/common/js/json.js"></script>
<script type="text/javascript">
var popupList = new NormalServiceCaller("SVC0008");
var listCnt = 0;

function fn_searchData(){
	var param = $("#popForm").serialize();
	popupList.searchSvc(function(data){
		
		/*페이징 세팅*/
		if(listCnt!=data.cnt){
			listCnt = data.cnt;
			paging = new PagingNaviFactory("pagingNaviArea",{totalRowCount : data.cnt }, function(){
				fn_searchData();
			});
			paging.initPageNavi();
		}
		/*페이징 세팅*/
		GFN_PAGENAVIGATION_VARS.pageStartNum = paging.getPageStartNum();
		var $tbody = $("#listTable tbody").empty();
		$.each(data.data, function(k, v){
			$tr = $("<tr>");
			$tr.append($("<td>").text(GFN_PAGENAVIGATION_VARS.pageStartNum--))
			   .append($("<td>").append($("<a/>").text(v.subject).attr({id : "link", href : "#"}).data("pNo",v.pNo)))
			   .append($("<td>").text(v.width))
			   .append($("<td>").text(v.height))
			   .append($("<td>").text(v.marginLeft))
			   .append($("<td>").text(v.marginTop))
           $tbody.append($tr);			   
		});		
		
	}, param);	
}
$(function(){
	fn_searchData();
	$("body").on("click","#link",function(e){
		e.preventDefault();
		$("#pNo").val($(this).data("pNo"));
		location.href = "popupView.php?pNo="+$(this).data("pNo");
		//$("#popForm").attr({action:"popupView.php"}).submit();
	});
});
</script>
<?include_once $_SERVER['DOCUMENT_ROOT'].'/common/util/commonViewInclude.php'?>
<body>
<form id="popForm" method="post">
  	<input type="hidden" name="pageIndex" id="pageIndex" value="1"/>
  	<input type="hidden" name="pNo" id="pNo"/>
  	
  	<table border="1" id="listTable">
  	<thead>
  		<th>번호</th>
  		<th>제목</th>
  		<th>가로</th>
  		<th>세로</th>
  		<th>상단마진</th>
  		<th>좌측마진</th>
  	</thead>
  	<tbody></tbody>
  	</table>
  	
  	<div id="pagingNaviArea"></div>
</form>  	
</body>
</html>